<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增【请填写功能名称】')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-travelrequest-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">驾驶员：</label>
                <div class="col-sm-8">
                    <select name="DriverID" class="form-control m-b" th:with="type=${@veDriversServiceImpl.getVeDriversList()}">
                        <option th:each="driver : ${type}" th:text="${driver.DriverName}" th:value="${driver.DriverID}"></option>
                    </select>
                </div>
            </div>
            <!-- <div class="form-group">
            <label class="col-sm-3 control-label">车名：</label>
            <div class="col-sm-8">
                <select name="VehicleID" class="form-control m-b" th:with="type=${@veVehiclesServiceImpl.getVeVehiclesList()}">
                    <option th:each="vehicle : ${type}" th:text="${vehicle.VehicleName}" th:value="${vehicle.VehicleID}"></option>
                </select>
            </div>
        </div>-->

            <div class="form-group">
                <label class="col-sm-3 control-label">出发地点：</label>
                <div class="col-sm-8">
                    <select name="DepartureLoc" class="form-control m-b" th:with="type=${@veStationinfoServiceImpl.getVeStationinfoList()}">
                        <option th:each="station : ${type}" th:text="${station.Address}" th:value="${station.StationID}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">目的地：</label>
                <div class="col-sm-8">
                    <select name="Destination" class="form-control m-b" th:with="type=${@veStationinfoServiceImpl.getVeStationinfoList()}">
                        <option th:each="station : ${type}" th:text="${station.Address}" th:value="${station.StationID}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">出发日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="DepartDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">预计返回日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="ExpectedReturnDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">出差目的：</label>
                <div class="col-sm-8">
                    <input name="Purpose" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">申请状态：</label>
                <div class="col-sm-8">
                    <select name="Status" class="form-control m-b"
                            th:with="type=${@dict.getType('sys_travel_status')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="Notes" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/travelrequest"
        $("#form-travelrequest-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-travelrequest-add').serialize());
            }
        }

        $("input[name='DepartDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='ExpectedReturnDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>